{% extends "administrative/base.html" %}

{% block page_link %}
    <script src="../../static/administrative/js/my_issue_detail.js"></script>
    <link rel="stylesheet" href="../../static/system_setup/css/zTreeStyle/zTreeStyle.css">
    <link rel="stylesheet" href="../../static/administrative/css/style.css">
    <link href="../../static/administrative/css/textbus.min.css" rel="stylesheet">
    <script src="../../static/administrative/js/textbus.min.js"></script>
{% endblock %}


{% block style %}
    <style>
        .add_class{
            background: #1E90FF;
        }
        .file {
            position: relative;
            display: inline-block;
            border-radius: 4px;
            padding: 4px 12px;
            overflow: hidden;
            color: #1E88C7;
            text-decoration: none;
            text-indent: 0;
            line-height: 20px;
        }
        .file input {
            position: absolute;
            font-size: 100px;
            right: 0;
            top: 0;
            opacity: 0;
        }
        .file:hover {
            background: #AADFFD;
            border-color: #78C3F3;
            color: #004974;
            text-decoration: none;
        }
        tr{
            height: 35px;
        }
        th{
            text-align: center;
        }
        table {
            table-layout: fixed;
        }
        td:first-child, th:first-child {
            position:sticky;
            left:0; /* 首行永远固定在左侧 */
            z-index:1;
        }
        thead tr th {
            position:sticky;
            top:0; /* 列首永远固定在头部  */
            background-color: #E8E8E8;
        }
        th:first-child{
            z-index:2;
        }
        .li-class{
            list-style: none;
            margin-top: 2%;
            color: #0b0b0b;
            cursor: pointer;
        }
        .preserve{
            height: 30px;width: 90%;background: #0070c1;color: #ffffff;border-radius: 3px
        }
        li{
            list-style-type: none;
        }
        .model_li{
            color: #3f414d;
            width: 25%;
            cursor: pointer;
            display: none;
        }
        .basic-tabs {
            box-shadow: 0 1.5px 0 0 #1E90FF;
            color: #1E90FF;
        }
        .basic {
            width: 5%;
            height: 40px;
            line-height: 40px;
            text-align: center;
            display: inline-block;
            vertical-align: top;
            cursor: pointer;
        }
    </style>
{% endblock %}



{% block right_content %}
{#    <div class="headline">#}
{#        <div style="width: 15%;height: 100%;line-height: 40px;float: left;padding-left: 1%;">#}
{#            <a href="my_issue.html" style="color: #0b0b0b;">#}
{#                <i class="iconfont icon-gongwenfawen"></i>#}
{#                <span> 我的申请</span>#}
{#            </a>#}
{##}
{#        </div>#}
{#        <div style="width: 7%;text-align: center;height: 100%;line-height: 40px;float: right;">#}
{#            <button id="add_station" type="button" class="btn btn-default add-station preserve" onclick="update_issue()">修改重提</button>#}
{#        </div>#}
{##}
{#    </div>#}

    <div style="width: 100%;height: 40px;padding-left: 1%;box-shadow: 0 1px 0 0 #CFCFCF;">

        <div id="create-menu" class="basic basic-tabs" onclick="Control_navigation(this.id)">
            申请详情
        </div>

        <div id="flow-status" class="basic" onclick="Control_navigation(this.id)">
            流程状态
        </div>

        <div id="topic_main" class="basic" onclick="Control_navigation(this.id)">
            议题正文
        </div>

        <div style="width: 7%;text-align: center;height: 100%;line-height: 40px;float: right;">
            <button id="add_station" type="button" class="btn btn-default add-station preserve" onclick="update_issue()">修改重提</button>
        </div>
    </div>


    <div id="menu_from" class="right-box" style="width: 100%;height: 95%;overflow: auto;padding-bottom: 1%;">
        <div id="print_div" style="width: 70%;margin-top: 1%;margin-left: 15%;display: inline-block;box-shadow: -5px 10px 3px 0 #CFCFCF">
            <div style="width: 99%;background: white;">
                <div id="print_div1" style="width: 90%;margin-left: 4.5%"><!--startprint-->
                    <style>
                        @font-face {
                            font-family: 'FZXBSJW';
                            src: local('FZXBSJW'),
                            url('../../static/administrative/fonts/FZXBSJW.TTF') format("truetype");
                        }

                        @font-face {
                            font-family: '仿宋_GB2312';
                            src: local('仿宋_GB2312'),
                            url('../../static/administrative/fonts/仿宋_GB2312.ttf') format("truetype");
                        }
                    </style>
                    <div style="color: black;font-family: FZXBSJW;font-size: 24px;text-align: center;height: 60px;line-height: 60px;width: 100%;" >{{ issue_type }}</div>
                    <div id='issue_number' style="margin-top: 1%;color: black;width: 100%;text-align: left;font-family: 仿宋_GB2312;font-size: 18.6px;padding-left: 25px;font-weight: bold">议题编号：{{ issue_number }}</div>
                    <div style="padding-left: 1%;padding-right: 1%;width: 100%;color: #0b0b0b;">
                        <table style="width: 100%;">
                            <tr style="margin-left: 1%;">
                                <td style="width: 20%;border: black solid 0.5px;text-align: center;height: 75px;line-height: 35px;color: black;font-family: 仿宋_GB2312;font-size: 18.6px">提交部门</td>
                                <td id='submission_department' style="width: 20%;border: black solid 0.5px;text-align: center;height: 75px;line-height: 35px;color: black;font-family: 仿宋_GB2312;font-size: 18.6px">{{ submission_department }}</td>
                                <td style="width: 15%;border: black solid 0.5px;text-align: center;height: 75px;line-height: 35px;color: black;font-family: 仿宋_GB2312;font-size: 18.6px">
                                    <div>负责人</div>
                                    <div>签&nbsp&nbsp字</div>
                                 </td>
                                <td id='in_charge_signature' style="width: 15%;border: black solid 0.5px;text-align: center;height: 75px;line-height: 35px;color: black;font-family: 仿宋_GB2312;font-size: 18.6px">
                                    <div><div style='width: 100%;height: 40px;'><input type='radio'  name='in_charge_signature' value='同意'> 同意<input type='radio' name='in_charge_signature' value='不同意' style='margin-left: 2%;'> 不同意</div></div>
                                </td>
                                <td style="width: 15%;border: black solid 0.5px;text-align: center;height: 75px;line-height: 35px;color: black;font-family: 仿宋_GB2312;font-size: 18.6px">
                                     <div>提交</div>
                                     <div>日期</div>
                                </td>
                                <td id='submission_date' style="width: 15%;border: black solid 0.5px;text-align: center;height: 75px;line-height: 35px;color: black;font-family: 仿宋_GB2312;font-size: 18.6px">{{ submission_date }}</td>
                            </tr>
                        </table>

                        <table style="width: 100%;">
                            <tr style="margin-left: 1%;">
                                <td style="width: 20%;border-top: black;border-right: black solid 0.5px;border-left: black solid 0.5px;border-bottom: black solid 0.5px;height: 75px;line-height: 35px;text-align: center;color: black;font-family: 仿宋_GB2312;font-size: 18.6px">议&nbsp&nbsp&nbsp&nbsp题</td>
                                <td id="topics" style="width: 80%;border-top: black;border-right: black solid 0.5px;border-left: black solid 0.5px;border-bottom: black solid 0.5px;height: 35px;line-height: 35px;padding-left: 1%;color: black;font-family: 仿宋_GB2312;font-size: 18.6px" >{{ topics }}</td>
                            </tr>
                            <tr style="margin-left: 1%;">
                                <td style="width: 20%;border-right: black solid 0.5px;border-left: black solid 0.5px;border-bottom: black solid 0.5px;height: 150px;line-height: 35px;text-align: center;color: black;font-family: 仿宋_GB2312;font-size: 18.6px">议题要点</td>
                                <td id="key_issues" style="width: 80%;border-right: black solid 0.5px;border-left: black solid 0.5px;border-bottom: black solid 0.5px;height: 35px;line-height: 35px;padding-left: 1%;color: black;font-family: 仿宋_GB2312;font-size: 18.6px" >{{ key_issues }}</td>
                            </tr>
                        </table>

                        <table id="jointly" style="width: 100%;">

                        </table>

                        <table style="width: 100%;">
                            <tr style="margin-left: 1%;">
                                <td style="width: 20%;border-top: black;border-right: black solid 0.5px;border-left: black solid 0.5px;border-bottom: black solid 0.5px;height: 150px;line-height: 35px;text-align: center;color: black;font-family: 仿宋_GB2312;font-size: 18.6px">
                                    <div>分管领导</div>
                                    <div>意见</div>
                                </td>
                                <td id="leader_opinion" style="width: 80%;border-top: black;border-right: black solid 0.5px;border-left: black solid 0.5px;border-bottom: black solid 0.5px;height: 35px;line-height: 35px;padding-left: 1%;color: black;font-family: 仿宋_GB2312;font-size: 18.6px">{{ leader_opinion }}</td>
                            </tr>
                        </table>

                         <table style="width: 100%;">
                            <tr style="margin-left: 1%;">
                                <td style="width: 20%;border-top: black;border-right: black solid 0.5px;border-left: black solid 0.5px;border-bottom: black solid 0.5px;height: 120px;line-height: 35px;text-align: center;color: black;font-family: 仿宋_GB2312;font-size: 18.6px">
                                    <div>主要负责人</div>
                                    <div>意见</div>
                                </td>
                                <td id="main_process" style="width: 80%;border-top: black;border-right: black solid 0.5px;border-left: black solid 0.5px;border-bottom: black solid 0.5px;height: 35px;line-height: 35px;padding-left: 1%;color: black;font-family: 仿宋_GB2312;font-size: 18.6px" >{{ main_opinion }}</td>
                            </tr>
                        </table>

                        <table style="width: 100%;">
                            <tr style="margin-left: 1%;">
                                <td style="width: 20%;border-top: black;border-right: black solid 0.5px;border-left: black solid 0.5px;border-bottom: black solid 0.5px;height: 120px;line-height: 35px;text-align: center;color: black;font-family: 仿宋_GB2312;font-size: 18.6px">处理结果</td>
                                <td id="processing_result" style="width: 80%;border-top: black;border-right: black solid 0.5px;border-left: black solid 0.5px;border-bottom: black solid 0.5px;height: 35px;line-height: 35px;padding-left: 1%;color: black;font-family: 仿宋_GB2312;font-size: 18.6px" contenteditable="true"></td>
                            </tr>
                        </table>
                     </div>
                    <div style="margin-left: 1%;text-align:left">
                        <span style="text-align: left;font-family: 仿宋_GB2312;font-size: 18.6px;color: black;">备注：</span>
                        <div style="display:inline;text-align: left;font-family: 仿宋_GB2312;font-size: 18.6px;color: black;">
                            <span> 1.此表于{{ word_detail }}委会召开前三天提交，提交后原则上不能修改。</span>
                            <br>
                            <span>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp2.此表字体及格式已设定，请勿改动；</span>
                        </div>
                    </div>
                </div>

                <div style="height: 30px;"></div>
            </div>

            <br>
            <div style="page-break-after:always;"></div>

            <!--endprint-->
            <iframe id="iframe1" style="display: none"></iframe>
            <div style="width: 100%;text-align: center;height: 50px;margin-top: 10px;">
                <button onclick="but_click()" style="width: 100px;border-radius: 3px;border: #dfdfdf solid 0.5px;">打印</button>
                <div id="issue_id" style="display: none">{{ issue_id }}</div>
                <div id="nuclear_draft_name" style="display: none"></div>
                <div id="issue_now_status" style="display: none"></div>
            </div>


        </div>

        <div id="process_status" style="width: 100%;height: 88%;display: none;margin-top: 0.2%;">
            <div style="height: 88%;width: 100%;overflow: auto;">
                <table class="table table-hover table-bordered" style="border-collapse: collapse;width: 100%;">
                    <thead>
                    <tr>
                        <th scope="col" style="width: 8%;">序号</th>
                        <th scope="col" style="width: 8%;">节点</th>
                        <th scope="col" style="width: 8%;">操作状态</th>
                        <th scope="col" style="width: 8%;">流程类别</th>
                        <th scope="col" style="width: 8%;">处理时间</th>
                        <th scope="col" style="width: 8%;">意见</th>
                    </tr>
                    </thead>
                    <tbody style="overflow: auto;" id="t_table1"></tbody>
                </table>
            </div>
        </div>

        <div id="issue_main" style="width: 100%;height: 100%;display: none;">
            <iframe src="{{ IssueInfoFile_file_path }}" width="100%" height="100%"></iframe>
        </div>
    </div>

    <div class="modal fade bd-example-modal-sm" tabindex="-1" role="dialog" aria-hidden="true">
        <div class="modal-dialog modal-sm" style="margin-top: 10%;">
            <div class="modal-content" style="height: 150px;border-radius: 7px;width: 300px;background: #F8F8FF;border: #1E90FF solid 1px;">
                <div class="modal-header" style="height: 40px;background: #1E90FF;border-top-left-radius: 7px;border-top-right-radius: 7px;">
                    <h5 class="modal-title" style="line-height: 40px;width: 40%;text-align: center;color: #ffffff;">
                        提示对话框
                    </h5>
                    <button id="close-model2" type="button" class="close" data-dismiss="modal" aria-label="Close" style="margin-right: 3%;line-height: 40px;">
                        <span aria-hidden="true" style="font-size: 28px;color: white;">&times;</span>
                    </button>
                </div>
                <div class="modal-body" style="height: 50px;line-height: 60px;text-align: center;">
                    <p id="Confirm-content"></p>
                </div>
                <div class="modal-footer" style="height: 40px;">
                    <button id="countersign" type="button" class="btn btn-primary" aria-label="Close"
                            style="margin-left: 2%;margin-right: 2%;background: #1E90FF;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;确&nbsp;认&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    </button>
                </div>
            </div>
        </div>
    </div>


{% endblock %}


{% block script %}
    <script src="../../static/public_file/js/jquery.min.js"></script>
    <script src="../../static/system_setup/js/jquery.ztree.all.min.js"></script>
    <script src="../../static/system_setup/js/django.ajax.post.csrf.js"></script>
    <script>
        var present = {{ present | safe }};
        var t_table1 = document.getElementById("t_table1");
        for (var j = 0; j < Object.keys(present).length; j++) {
            var key = Object.keys(present)[j];
            var tr = document.createElement("tr");
            var td = document.createElement("td");
            var td1 = document.createElement("td");
            var td2 = document.createElement("td");
            var td3 = document.createElement("td");
            var td4 = document.createElement("td");
            var td5 = document.createElement("td");
            td.innerHTML = j + 1;
            td.style.textAlign = "center";
            td1.innerHTML = present[key]["real_name"];
            td1.style.textAlign = "center";
            td2.innerHTML = present[key]["status"];
            td2.style.textAlign = "center";
            td3.innerHTML = present[key]["leader_type"];
            td3.style.textAlign = "center";
            td4.innerHTML = present[key]["parse_time"];
            td4.style.textAlign = "center";
            td5.innerHTML = JSON.stringify(present[key]["opinion"]);
            td5.style.paddingLeft = "1%";
            tr.appendChild(td);
            tr.appendChild(td1);
            tr.appendChild(td2);
            tr.appendChild(td3);
            tr.appendChild(td4);
            tr.appendChild(td5);
            t_table1.appendChild(tr);
        }


        var returnList = {{ returnList | safe }};
        console.log(returnList)
        for (var i=0; i<returnList.length; i++){
            var tr = document.createElement("tr");
            var td = document.createElement("td");var td1 = document.createElement("td");var td2 = document.createElement("td");var td3 = document.createElement("td");
            td.innerHTML = "协办部门"+String(i+1);td.style.width="20%";td.style.borderLeft="black solid 0.5px";td.style.borderRight="black solid 0.5px";td.style.borderBottom="black solid 0.5px";td.style.height="75px";td.style.lineHeight="35px";td.style.textAlign="center";td.style.color="black";td.style.fontFamily="仿宋_GB2312";td.style.fontSize="18.6px";
            td1.innerHTML=returnList[i]["sponsor"];td1.setAttribute("id", "is_department"+String(i+1));td1.style.width="20%";td1.style.borderRight="black solid 0.5px";td1.style.borderLeft="black solid 0.5px";td1.style.borderBottom="black solid 0.5px";td1.style.paddingLeft="1%";td1.style.lineHeight="35px";td.style.color="black";td1.style.fontFamily="仿宋_GB2312";td1.style.fontSize="18.6px";
            td2.innerHTML = "负责人签字";td2.style.width="30%";td2.style.borderRight="black solid 0.5px";td2.style.borderLeft="black solid 0.5px";td2.style.borderBottom="black solid 0.5px";td2.style.textAlign="center";td2.style.height="75px";td2.style.lineHeight="35px";td2.style.color="black";td2.style.fontFamily="仿宋_GB2312";td2.style.fontSize="18.6px";
            if (returnList[i]["type"] === 1){
                td3.innerHTML = '<div><span>'+returnList[i]["status"]+'</span><img src="'+returnList[i]["autograph_url"]+'" height="70px"></div>';
                td3.style.width="30%";td3.style.height="35px";td3.style.lineHeight="35px";td3.style.paddingLeft="1%";td3.style.borderRight="black solid 0.5px";td.style.borderLeft="black solid 0.5px";td3.style.borderBottom="black solid 0.5px";td3.style.color="black";td3.style.fontFamily="仿宋_GB2312";td3.style.fontSize="18.6px";
            }else if (returnList[i]["type"] === 2){
                td3.innerHTML = "<div><div style='width: 100%;height: 40px;'><input type='radio' name='nuclear_draft"+String(i+1)+"' value='同意'> 同意<input type='radio' name='nuclear_draft"+String(i+1)+"' value='不同意' style='margin-left: 2%;'> 不同意</div></div>";
                td3.style.width="30%";td3.style.height="35px";td3.style.lineHeight="35px";td3.style.paddingLeft="1%";td3.style.borderRight="black solid 0.5px";td.style.borderLeft="black solid 0.5px";td3.style.borderBottom="black solid 0.5px";td3.style.color="black";td3.style.fontFamily="仿宋_GB2312";td3.style.fontSize="18.6px";
                document.getElementById("nuclear_draft_name").innerText= 'nuclear_draft'+String(i+1)
            }else {
                td3.innerHTML = "<div><div style='width: 100%;height: 40px;'><input type='radio' name='nuclear_draft"+String(i+1)+"' value='同意' disabled> 同意<input type='radio' name='nuclear_draft"+String(i+1)+"' value='不同意' style='margin-left: 2%;' disabled> 不同意</div></div>";
                td3.style.width="30%";td3.style.height="35px";td3.style.lineHeight="35px";td3.style.paddingLeft="1%";td3.style.borderRight="black solid 0.5px";td.style.borderLeft="black solid 0.5px";td3.style.borderBottom="black solid 0.5px";td3.style.color="black";td3.style.fontFamily="仿宋_GB2312";td3.style.fontSize="18.6px";
            }
            tr.appendChild(td);tr.appendChild(td1);tr.appendChild(td2);tr.appendChild(td3);
            document.getElementById("jointly").appendChild(tr);
        }

        var signature_status = {{ signature_status | safe }};
        console.log(signature_status)
        if (signature_status===1){
            document.getElementById("in_charge_signature").innerHTML= '<img src="{{ signature_pic }}" height="70px"></div>'
        }
        else if (signature_status===2){
            document.getElementById("in_charge_signature").innerHTML= '<div><span>不同意</span><img src="{{ signature_pic }}" height="70px"></div>'
        }
        else{
            document.getElementById("in_charge_signature").innerHTML= '<div><span>未处理</span><img src="{{ signature_pic }}" height="70px"></div>'
        }

          var is_main = {{ is_main | safe}};
        console.log(is_main);
        if (is_main===1){
            document.getElementById("main_process").innerHTML= "<div><div style='width: 100%;height: 40px;'><input type='radio' name='main_process' value='同意'> 同意<input type='radio' name='main_process' value='不同意' style='margin-left: 2%;'> 不同意</div></div><hr/>\n" +
                "                            <textarea id=\"main_opinion1\" name=\"\" cols=\"30\" rows=\"1\" style=\"margin-top: 1%;width: 100%;\"></textarea>";
        }
        else if (is_main===2){
            document.getElementById("main_process").innerHTML= '<img src="{{ main_signature_pic }}" height="70px"></div>'
        }
        else if (is_main===3){
            document.getElementById("main_process").innerHTML= '<div><span>{{ main_opinion }}</span><img src="{{ main_signature_pic }}" height="70px"></div>'
        }
        else if (is_main===4){
            document.getElementById("main_process").innerHTML= "<div><div style='width: 100%;height: 40px;'><input type='radio' name='main_process' value='同意' disabled='true'> 同意<input type='radio' name='main_process' value='不同意' style='margin-left: 2%;' disabled='true'> 不同意</div></div><hr/>\n" +
                "                            <textarea disabled='true' id=\"main_opinion1\" name=\"\" cols=\"30\" rows=\"1\" style=\"margin-top: 1%;width: 100%;\"></textarea>";
        }

        var is_leader = {{ is_leader | safe}};
        console.log(is_leader);
        if (is_leader===1){
            document.getElementById("leader_opinion").innerHTML= "<div><div style='width: 100%;height: 40px;'><input type='radio' name='leader_process' value='同意'> 同意<input type='radio' name='leader_process' value='不同意' style='margin-left: 2%;'> 不同意</div></div><hr/>\n" +
                "                            <textarea id=\"leader_opinion1\" name=\"\" cols=\"30\" rows=\"1\" style=\"margin-top: 1%;width: 100%;\"></textarea>";
        }
        else if (is_leader===2){
            document.getElementById("leader_opinion").innerHTML= '<img src="{{ leader_signature_pic }}" height="70px"></div>'
        }
        else if (is_leader===3){
            document.getElementById("leader_opinion").innerHTML= '<div><span>{{ leader_opinion }}</span><img src="{{ leader_signature_pic }}" height="70px"></div>'
        }
        else if (is_leader===4){
            document.getElementById("leader_opinion").innerHTML= "<div><div style='width: 100%;height: 40px;'><input type='radio' name='leader_process' value='同意' disabled='true'> 同意<input type='radio' name='leader_process' value='不同意' style='margin-left: 2%;' disabled='true'> 不同意</div></div><hr/>\n" +
                "                            <textarea disabled='true' id=\"leader_opinion1\" name=\"\" cols=\"30\" rows=\"1\" style=\"margin-top: 1%;width: 100%;\"></textarea>";
        }
        var issue_status = {{ issue_status | safe}};
        console.log(issue_status);
        if (issue_status === 1){
            document.getElementById("topics").setAttribute("contenteditable", "true");
            document.getElementById("key_issues").setAttribute("contenteditable", "true");
        }
        else {
            document.getElementById("add_station").style.display = 'none'
        }

         function click_ul_9() {
            if (document.getElementById("jiantou5").className === "iconfont icon-jiantou-shang"){
                document.getElementById("jiantou5").className = "iconfont icon-jiantou-xia";
                document.getElementById("dispatch-Administrator-1").style.display = "inline-block";
            }else {
                document.getElementById("jiantou5").className = "iconfont icon-jiantou-shang";
                document.getElementById("dispatch-Administrator-1").style.display = "none";
            }
        }

        function click_ul_10() {
            if (document.getElementById("jiantou4").className === "iconfont icon-jiantou-shang"){
                document.getElementById("jiantou4").className = "iconfont icon-jiantou-xia";
                document.getElementById("dispatch-Administrator").style.display = "inline-block";
            }else {
                document.getElementById("jiantou4").className = "iconfont icon-jiantou-shang";
                document.getElementById("dispatch-Administrator").style.display = "none";
            }
        }

    </script>
{% endblock %}
